package com.hong.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hong.bean.Relationship;
import com.hong.convert.RelationshipConvert;
import com.hong.dao.RelationshipMapper;
import com.hong.dto.relationship.CreateRelationshipParam;
import com.hong.service.RelationshipService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


@Service
public class RelationshipServiceImpl extends ServiceImpl<RelationshipMapper, Relationship>  implements RelationshipService {

    @Autowired
    private RelationshipConvert relationshipConvert;


    @Transactional(rollbackFor = Exception.class)
    @Override
    public Boolean create(CreateRelationshipParam param) {

        Relationship relationship = relationshipConvert.toEntity(param);

        boolean status = save(relationship);
        return status;

    }
}
